﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UltimatePlugin.Db.Cache;
using Zeta.TreeSharp;

namespace UltimatePlugin.Db
{
    public static class ActionHelper
    {
        public static bool CanCombatAction(object context)
        {
            EnvironmentCache.Refresh();
            HeroCache.Refresh();
            return (HeroCache.HitpointsCurrent > 0);
        }

        public static RunStatus TargetAction(object context)
        {
            RunStatus ret = RunStatus.Running;
            // CheckPotion 
            if ((HeroCache.AnimationState != Zeta.Internals.Actors.AnimationState.Casting) || (HeroCache.AnimationState != Zeta.Internals.Actors.AnimationState.Channeling))
            {
                // TP or Identifying ... 
                if (HeroCache.KillRadius < Constants.ExtendedKillRadiusForTp)
                {
                    HeroCache.ExtendKillRadius(20, Constants.ExtendedKillRadiusForTp);
                }
            }

            if (HeroCache.IsInCombat)
            {
                
            }
            return ret;
        }

        public static bool PausedAction(object context)
        {
            return true;
        }

        internal static bool CanVendorRunAction(object context)
        {
            return true;
        }

        internal static object DispatchItemAction(object context)
        {
            return true;
        }

        internal static object StashAction(object context)
        {
            return true;
        }

        internal static object SellAction(object context)
        {
            return true;
        }

        internal static object SalvageAction(object context)
        {
            return true;
        }

        internal static void IdentificationRequestAction(object sender, Zeta.CommonBot.ItemIdentifyRequestEventArgs e)
        {
            throw new NotImplementedException();
        }
    }
}
